package com.scraper.dao.hibernate;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.scraper.dao.AgencyDAO;
import com.scraper.model.Agency;

public class AgencyDAOImpl extends BaseDAOImpl<Agency> implements AgencyDAO{

	public AgencyDAOImpl() {
		super(Agency.class);
	}

	public Agency getByAgencyName(String agencyName) {
		Criteria criteria = getSession().createCriteria(entityClass);
		criteria.add(Restrictions.eq("agencyName", agencyName));
		return (Agency) criteria.uniqueResult();
	}
	
}
